package com.ptp.backendcertms.business.service.impl;

import com.ptp.backendcertms.api.external.dto.req.CodeReqDto;
import com.ptp.backendcertms.api.external.dto.res.CodeResDto;
import com.ptp.backendcertms.api.external.dto.res.EnumResDto;
import com.ptp.backendcertms.api.internal.constant.cert.CertificateStatusEnum;
import com.ptp.backendcertms.business.service.ICodeBusinessService;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 码值 服务实现
 *
 * @author songcongcong
 * @date 2025/5/6
 */
@Service
public class CodeBusinessServiceImpl implements ICodeBusinessService {

    @Override
    public CodeResDto getCodes(CodeReqDto reqDto) {
        CodeResDto codeResDto = new CodeResDto();
        List<EnumResDto> certificateStatus = Arrays.stream(CertificateStatusEnum.values()).map(t -> new EnumResDto(t.name(), t.getValue())).collect(Collectors.toList());
        codeResDto.setCertificateStatus(certificateStatus);
        return codeResDto;
    }
}
